<?php

class Enquiry extends AppModel {

/**
 * Name
 *
 * @var string
 */
    public $name = "Enquiry";
    
/**
 * hasMany
 *
 * @var array
 */

    var $hasMany = array(
        'EnquiryReply' => array(
            'className' => 'EnquiryReply'
        )                   
    );          


/**
 * virtual fields
 *
 * @var string
 **/    
    public $virtualFields = array(
        'name' => 'CONCAT(Enquiry.first_name, " ", Enquiry.last_name)'
    );

/**
 * Validation rules
 *
 * @var string
 **/    
    public $validate = array(
            'query' => array (
                'rule-1' => array ( 
                    'rule' => 'notEmpty',
                    'message' => 'Please enter subject'
                )
            ),  
            'email' => array (
                'rule-1' => array ( 
                    'rule' => 'notEmpty',
                    'message' => 'Please enter Email'
                ),
                'rule-2' => array ( 
                    'rule' => 'email',
                    'message' => 'Please enter a valid email'
                )
            )               
        );


}